
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台管理</title>
<link href="__PUBLIC__/ht/css/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/ht/js/jquery.js"></script>
<script type="text/javascript" src="__PUBLIC__/ht/js/action.js"></script>
</head>
<body>

<div class="aaa_pts_show_1">【 产品管理 】</div>

<div class="aaa_pts_show_2">
    <div>
       <div class="aaa_pts_4"><a href="{:U('Product/index')}">全部产品</a></div>
       <div class="aaa_pts_4"><a href="{:U('Product/add')}">添加产品</a></div>
    </div>
    <div class="aaa_pts_3">
      
      <div class="pro_4 bord_1">
         <div class="pro_5">产品名称：<input type="text" class="inp_1 inp_6" id="name" value="{$name}"></div>
         <div class="pro_5">
               推荐产品：
               <select class="inp_1 inp_6" id="tuijian">
			      <option value="">全部产品</option>
                  <option value="1" <?php echo $tuijian=='1' ? 'selected="selected"' : NULL ?>>推荐产品</option>
                  <option value="0" <?php echo $tuijian=='0' ? 'selected="selected"' : NULL ?>>非推荐产品</option>
	           </select>
         </div>  
         <div class="pro_6"><input type="button" class="aaa_pts_web_3" value="搜 索" style="margin:0;" onclick="product_option(0);"></div>
      </div>
      
      <table class="pro_3">
         <tr class="tr_1">
           <td style="width:80px;">ID</td>
           <td style="width:90px;">图片</td>
           <td style="width:130px;">所属店铺</td>
           <td>产品名称</td>
           <td style="width:100px;">价格/元</td>
           <td style="width:80px;">人气</td>
           <td style="width:90px;">是否新品</td>
           <td style="width:100px;">推荐</td>
           <td style="width:300px;">操作</td>
         </tr>
         <tbody id="news_option">
         <!-- 遍历 -->
          <volist name="productlist" id="v" empty="暂时没有数据">
           <tr>
             <td>{$v.id}</td>
             <td style="padding:3px 0;"><img src="__DATA__/{$v.photo_x}" width="80px" height="80px"/></td>
             <td>{$v.shangchang}</td>
             <td>{$v.name}</td>
             <td>{$v.price_yh}</td>
             <td>{$v.renqi}</td>
             <td><a href="{:U('set_new')}?pro_id={$v.id}&page={$page}&name={$name}"><if condition="$v.is_show eq 1"><label style="color:green;">是</label><else /><label style="color:gray;">否</label></if></a></td>
             <td><if condition="$v.type eq 1"><label style="color:green;">推荐</label></if></td>
            <td>
              <!-- <if condition="$v.pro_buff neq ''">
                <a href="{:U('Product/pro_guige')}?pid={$v.id}">
              <else />
              <a href="{:U('Product/set_attr')}?pid={$v.id}"></if><font style="color:red;">属性设置</font></a> | -->
              <a href="{:U('set_tj')}?pro_id={$v.id}&page={$page}&name={$name}&shop_id={$shop_id}&tuijian={$tuijian}">推荐</a> |
              <!-- <a onclick="win_open('{:U('Product/pinglun')}?id={$v.id}',1500,1200)">查看评论</a> | -->
              <a href="{:U('Product/add')}?id={$v.id}&page={$page}&name={$name}&shop_id={$shop_id}&tuijian={$tuijian}">修改</a> |
              <!-- <a href="{:U('Product/access')}?id={$v.id}">统计</a> | -->
              <a onclick="del_id_urls({$v.id})">删除</a>
             </td>
           </tr>
          </volist>
         <!-- 遍历 -->
         </tbody>
         <tr>
            <td colspan="10" class="td_2">
                  {$page_index}  
             </td>
         </tr>
      </table>      
    </div>
    
</div>
<script>
function product_option(page){
	
	var pid = $('#pid').val();
	if(pid == ''){
		pid = $('#ppid').val();
	}
  var obj={
	   "name":$("#name").val(),
	   "shop_id":pid,
	   "tuijian":$("#tuijian").val()
	  }
	  //alert(obj);exit();
  var url='?page='+page;
  $.each(obj,function(a,b){
	  url+='&'+a+'='+b;
	 });
  location=url;
}

function del_id_urls (pro_id) {
  if (confirm('您确定要删除吗？')) {
    location.href="{:U('del')}?did="+pro_id;
  };
}
</script>
</body>
</html>
